package singleton.demo02;

/**
 * 饿汉式(静态代码块)
 */
public class Singleton02 {

    private static final Singleton02 instance;

    static {
        instance = new Singleton02();
    }

    private Singleton02(){};

    public static Singleton02 getInstance() {
        return instance;
    }

    public String showInfo(String msg){
        return msg+", 你好";
    }
}
